/*
 DEV：传true、false，true为发布到线上，false为本地调试
 local：传true、false，true为链接正式接口，false为链接测试接口，默认为测试接口
 使用：import APIDEV from  './APIDEV'
 const API_ROOT = APIDEV(true)
 */
export default function(DEV,local){
  if(DEV){
    if (window.top.location.href.indexOf('tst.aoyunsoft.com') > -1) {
      var API_ROOT = 'http://bmptst.aoyunsoft.com/openapi'
    } else if ((window.top.location.href.indexOf('tst.aoyunsoft.com') == -1)) {
      var API_ROOT = location.protocol+'//bmp.aoyunsoft.com/openapi'
    }else {
      var API_ROOT = location.protocol+'//bmp.aoyunsoft.com/openapi'
    }
  }else{
    const API_ENV = local ? local: false;
//true 为正式版 ，false 为测试版
    const API_ROOT_DEV = 'http://bmptst.aoyunsoft.com/openapi'
    const API_ROOT_RELEASE = 'http://bmp.aoyunsoft.com/openapi'
    var API_ROOT = API_ENV ? API_ROOT_RELEASE : API_ROOT_DEV;
  }
  return API_ROOT
}
